﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CDB.LinqModel.Data;

namespace CDB.LinqModel
{
    public partial class New
    {
        #region Variable Declaration 
        private IDataRepository _dataObject;
        #endregion

        public New(IDataRepository dataObject)
            : this()
        {
            _dataObject = dataObject;
        }

        public void GetNewsById()
        {
            _dataObject.GetNewsById(this);
        }
        public void GetNewsByTitle()
        {
            _dataObject.GetNewsByTitle(this);
        }
        public void Create()
        {
            _dataObject.CreateNews(this);
        }
        public void Update()
        {
            _dataObject.UpdateNews(this);
        }
        public void Delete()
        {
            _dataObject.DeleteNews(this);
        }
        public List<New> GetAllNews()
        {
            return _dataObject.GetAllNews();
        }
    }
}
